package com.mdinfo.system.param;

import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

/**
 * Created by Administrator on 2017/11/29.
 */
public class DeptParam {

    @Data
    public static class AddParam{
        @NotNull(message = "不能为空")
        @Length(min = 1,max = 10,message = "长度为1-10")
        private String shortName;   //简称

        @NotNull(message = "不能为空")
        @Length(min = 1,max = 50,message = "长度为1-50")
        private String fullName;    //全称

        @NotNull(message = "不能为空")
        @Min(value = 0,message = "最小值为0")
        private Integer pid;        //父id

        @NotNull(message = "不能为空")
        @Length(min = 1,max = 10,message = "长度1-10")
        private String mgrName;     //管理人员

        @NotNull(message = "不能为空")
        private String mgrPhone;    //管理人员电话

        private Integer zoom;       //地图缩放比例
        private Double lng;         //经度
        private Double lat;         //纬度
        private String location;    //位置
    }

    @Data
    public static class ModifyParam{
        @NotNull(message = "不能为空")
        @Min(value = 1,message = "最小值为1")
        private Integer deptId;     //部门id

        @NotNull(message = "不能为空")
        @Length(min = 1,max = 10,message = "长度为1-10")
        private String shortName;        //名称

        @NotNull(message = "不能为空")
        @Length(min = 1,max = 50,message = "长度为1-50")
        private String fullName;    //全称

        @NotNull(message = "不能为空")
        @Min(value = 0,message = "最小值为0")
        private Integer pid;        //父id

        @NotNull(message = "不能为空")
        @Length(min = 1,max = 10,message = "长度1-10")
        private String mgrName;     //管理人员

        @NotNull(message = "不能为空")
        private String mgrPhone; //管理人员电话

        private Integer zoom;       //地图缩放比例
        private Double lng;         //经度
        private Double lat;         //纬度
        private String location;    //位置
    }

    @Data
    public static class DeleteParam{
        @NotNull(message = "不能为空")
        @Min(value = 1,message = "最小值为1")
        private Integer deptId;
    }

    @Data
    public static class ListOwnParam{
        @NotNull(message = "不能为空")
        @Min(value = 0,message = "最小值为0")
        private Integer start;

        @NotNull(message = "不能为空")
        @Range(min = 1,max = 50,message = "最小值1,最大值50")
        private Integer num;

        private String key;
    }

    @Data
    public static class MyDeptIdlistParam{
        private Integer deptId;
    }
}
